Increase test coverage: Array.prototype reverse #2728
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The coverage is measured by the following script, using
--jerry-test-suite --test262 --unittests --jerry-tests
:https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py
Comment added for each cases containing which part of the ES5.1 it tests.
Ran the test code in Gecko, V8, SpiderMonkey engines and got the same result.
Branch coverage:
I spent a lot of time finding a way to trigger the last branch, but I could not. (
ecma-builtin-array-prototype.c
, line: 648) The following line needs to fail:ECMA_TRY_CATCH (put_value, ecma_op_object_put (obj_p, upper_str_p, lower_value, true), ret_value);
Also found an opportunity to optimize, the second condition was not needed in that else if branch, as if the code reaches there, it cant be false.
JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]